package com.haoshuang.zhouzhoubang.ui.adapter

import com.chad.library.adapter4.BaseQuickAdapter
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemAddressManagementBinding
import com.haoshuang.zhouzhoubang.model.bean.AddressBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter


class AddresManagementAdapter(data: MutableList<AddressBean>):
    BaseBindingQuickAdapter<AddressBean, ItemAddressManagementBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: AddressBean?) {
        val binding = ItemAddressManagementBinding.bind(holder.itemView)
        binding.apply {
            if (item?.is_default==1){
                ivRadioIcon.setImageResource(R.mipmap.dz_ok)
            }else{
                ivRadioIcon.setImageResource(R.mipmap.dz_wx)
            }

            tvUserName.text = "${item?.real_name}    ${item?.phone}"
            tvCity.text = "${item?.province}${item?.city}${item?.district}${item?.detail}"


        }
    }
}